This invention relates to the xe2x80x9cbootxe2x80x9d process of computers, such as personal computers. More particularly, the present invention relates to an improved technique for initializing certain devices, such as floppy drives, hard drives, compact disk drives, etc., during the start-up of a computer.
The original 80xc3x9786-based personal computers (PC""s) booted from a combination of the PC""s BIOS (Basic Input/Output System) firmware stored in read-only memory (ROM) and an operating system (OS) stored on a floppy disk installed in the floppy drive. Once fixed disks, or hard drives, became available, PC""s were developed with the ability to boot from the hard drives. Today, PC""s still commonly boot from a hard drive, but the PC industry has also developed a standard by which PC""s can boot from a compact disk (CD-ROM). This standard is known as the xe2x80x9cEl Torito Bootable CD-ROM Format Specification.xe2x80x9d
To boot from the floppy drive, the BIOS firmware begins the initial boot process, but then xe2x80x9ccallsxe2x80x9d the standard interrupt 13h (INT 13h) to access the floppy drive xe2x80x9chandlerxe2x80x9d (software that interfaces with the floppy drive) to complete the boot process and load the OS from the floppy disk. (The xe2x80x9chxe2x80x9d appended to a number indicates hexadecimal numbering.) To install the hard drive upon start-up so that the PC boots from it instead of from the floppy drive, the BIOS firmware moves the floppy drive handler from INT 13h to the standard INT 40h and places the handler for the hard drive in the INT 13h location. The process of replacing the INT 13h handler and retaining the previous INT 13h handler is commonly called xe2x80x9chookingxe2x80x9d INT 13h. If an additional hard drive, option ROM, xe2x80x9cPlug-and-Playxe2x80x9d device or other INT 13h device is installed during the start-up, then firmware for the additional device xe2x80x9chooksxe2x80x9d INT 13h again, retaining the previous INT 13h handler in order to pass on access requests for other devices. It is possible for several INT 13h devices to be installed with each device placing its own handler at INT 13h and retaining the previous INT 13h handler, thereby creating a xe2x80x9cchainxe2x80x9d of INT 13h devices.
An exemplary prior art procedure 100 for installing an INT 13h device (e.g. a hard drive) at the start-up of a PC is shown in FIG. 1. Once the procedure 100 starts (step 102), the software reads (step 104) the current hard drive count and determines (step 106) whether the hard drive count is zero, indicating whether another INT 13h hard drive has already been installed. If no other INT 13h hard drive has been installed, then the current device handler for the INT 13h (assumed to be the floppy drive handler) is redirected (step 108) to the INT 40h. After redirecting (step 108) the floppy drive handler or if the hard drive count is not zero (step 106), the procedure 100 xe2x80x9chooksxe2x80x9d (step 110) the current INT 13h, thereby installing the new INT 13h device. The new INT 13h device is then designated (step 112) with a device number equal to the current hard drive count plus 80h, since add-in drives. (e.g. hard drives, CD-ROMs, magneto optical drives, removable hard drives, etc.) are designated as devices 80h through FFh. (Floppy drives are designated as devices 00h through 7Fh.) The hard drive count is then incremented (step 114) by one, and the procedure 100 ends (step 116).
An exemplary prior art procedure 118 for an INT 13h device handler to respond to an access request is shown in FIG. 2. Once the procedure 118 starts (step 120), it is determined (step 122) whether the device number specified by the calling program in the standard DL register is the same as the device number for the current INT 13h device, indicating that this device is the requested device. If this device is the requested device, then the access request is processed (step 124) and the appropriate code (e.g. indicating success or failure) is returned (step 126) to the calling program. If this device is not the requested device (step 122), then if the device number specified in the DL register is less than 80h (step 128), indicating that the floppy drive is the requested device, then the procedure 118 calls (step 130) INT 40h to handle the access request to the floppy drive. If the device number specified in the DL register is not less than 80h (step 128), indicating that the requested device is another INT 13h device (e.g. another hard drive), then the procedure 118 calls (step 132) the next entry (which was xe2x80x9chookedxe2x80x9d at step 110 in the procedure 100 in FIG. 1) in the chain of INT 13h devices. The procedure 118 ends at step 134.
States 136, 138 and 140 of a typical prior art PC are shown in FIG. 3 prior to the installation of any INT 13h devices (state 136), after the installation of one INT 13h device (state 138) and after the installation of a second INT 13h device (state 140). At state 136, there are no added INT 13h devices, such as hard drives, indicated by the hard drive count. There is one floppy drive (not shown) indicated by the floppy drive count. The chain 142 of INT 13h devices includes only the standard system handler 144 for the floppy drive. The chain 146 of INT 40h devices is empty or may include a xe2x80x9cdummyxe2x80x9d handler 148 or the system handler 144. Only the system handler 144 is able to respond to an access request according to the procedure 118 (FIG. 2).
At state 138, one INT 13h device, such as a hard drive (not shown), has been installed by the procedure 100 (FIG. 1) in a PC previously having the state 136. There are the one hard drive indicated by the hard drive count and one floppy drive (not shown) indicated by the floppy drive count. The chain 142 of INT 13h devices now includes the device handler 150 for the INT 13h device having device number 80h followed by the original system handler 144, since the previous INT 13h handler was xe2x80x9chookedxe2x80x9d at step 110 (FIG. 1) in the procedure 1006. Additionally, the chain 146 of INT 40h devices now includes the original system handler 144, since the system handler 144 was redirected to INT 40h at step 108 (FIG. 1) in the procedure 100. Therefore, if an access request is not directed to the device numbered 80h, as determined from the DL register at step 122 (FIG. 2) of the procedure 118 (FIG. 2), the device handler 150 will redirect the access request to the system handler 144 at step 130 or 132 (FIG. 2) of the procedure 118.
At state 140, the second INT 13h device (not shown) has been installed by the procedure 100 (FIG. 1) in a PC previously having the state 138. There are two hard drives and one floppy drive indicated by the hard drive count and the floppy drive count, respectively. The chain 142 of INT 13h devices, as generated by the procedure 100, now includes the device handler 152 for the INT 13h device numbered 81h followed by the device handler 150 the INT 13h device numbered 80h followed by the system handler 144. Additionally, the chain 146 of INT 40h devices still includes the system handler 144. Therefore, when the device handler 152 receives an access request under the procedure 118 (FIG. 2), if the access request is not directed to the device numbered 81h, as determined at step 122 (FIG. 2), the device handler 152 will pass the access request either to the system handler 144 (step 130, FIG. 2) or to the device handler 150 (step 132, FIG. 2). If the device handler 152 passes the access request to the device handler 150 (step 132), then if the device handler 150 determines at step 122 (FIG. 2) that the access request is not directed to the device numbered 80h, the device handler 150 passes the access request to the system handler 144 at step 130 or 132 (FIG. 2).
States 154, 156,158 and 160 of a typical prior art PC are shown in FIG. 4 after the installation of an xe2x80x9cEl Toritoxe2x80x9d device in combination with the installation of one or more INT 13h devices. An xe2x80x9cEl Toritoxe2x80x9d device emulates either a bootable floppy drive or a bootable hard drive or references an executable application, referred to as xe2x80x9cfloppy emulation,xe2x80x9d xe2x80x9chard drive emulationxe2x80x9d and xe2x80x9cno emulation,xe2x80x9d respectively.
The state 154 shows the typical prior art PC after the installation of a xe2x80x9cno emulation El Toritoxe2x80x9d device into a PC previously having the state 136 shown in FIG. 3. Since the hard drive count was zero, the process 100 (FIG. 1) copied the previous INT 13h handler (the system handler 144) to INT 40h at step 108 (FIG. 1). Then the process 100 inserted (step 110) a xe2x80x9cno emulationxe2x80x9d handler 162 with any appropriate non-conflicting device number in the range 81h to FFh for the xe2x80x9cEl Toritoxe2x80x9d device into the INT 13h chain 142 in front of the system handler 144. According to the xe2x80x9cEl Toritoxe2x80x9d standard, however, the installation of the xe2x80x9cno emulationxe2x80x9d handler 162 does not increment the hard drive count at step 114 (FIG. 1) of the procedure 100 since no hard drive has actually been added to the PC.
The state 156 shows the typical prior art PC after the installation of an INT 13h device into a PC previously having the state 154. Since the hard drive count is still zero at step 106 (FIG. 1), the procedure 100 (FIG. 1) copies the current INT 13h handler (the xe2x80x9cno emulationxe2x80x9d handler 162) to INT 40h, effectively erasing the system handler 144 from the INT 40h chain 146. The procedure 100 then inserts a device handler 164 for the INT 13h device numbered 80h into the INT 13h chain 142 in front of the xe2x80x9cno emulationxe2x80x9d handler 162. When an access request is issued for the original floppy drive (device number 00h), the device handler 164 reissues the access request at step 130 (FIG. 2) of the procedure 118 (FIG. 2) as an INT 40h request. As an INT 40h request, however, the access request encounters the xe2x80x9cno emulationxe2x80x9d handler 162 in the INT 40h chain 146. The xe2x80x9cno emulationxe2x80x9d handler 162 continues to reissue the access request at step 130 of the procedure 118 as an INT 40h request, resulting in an infinite loop that never reaches the system handler 144 for the floppy drive.
The state 158 shows the typical prior art PC after the installation of a xe2x80x9cfloppy emulation El Toritoxe2x80x9d device into a PC previously having the state 138 shown in FIG. 3. A xe2x80x9cfloppy emulationxe2x80x9d handler 166 for the xe2x80x9cfloppy emulation El Toritoxe2x80x9d device is inserted into the INT 13h chain 142 in front of the device handler 150. The xe2x80x9cEl Toritoxe2x80x9d standard requires that xe2x80x9cfloppy emulationxe2x80x9d devices have device number 00h. Therefore, when the xe2x80x9cfloppy emulationxe2x80x9d handler 166 encounters an access request for a device number that is not 00h at step 122 (FIG. 2) of the procedure 118 (FIG. 2), the access request is passed either to the system handler 144 (step 130, FIG. 2) or to the device handler 150 (step 132, FIG. 2). Upon installation of the xe2x80x9cfloppy emulationxe2x80x9d device, the PC is reconfigured to give the original floppy drive a device number of 01h, but the system handler 144 for the original floppy drive is still configured to respond as device number 00h. Therefore, when the device number is 01h, the xe2x80x9cfloppy emulationxe2x80x9d handler 166 decrements the device number to 00h before passing the access request to the system handler 144 and increments the device number back to 01h before returning the response to the calling program.
The state 160 shows the typical prior art PC after the installation of a second INT 13h device into a PC previously having the state 158. A device handler 168 for the INT 13h device, having device number 81h, is inserted into the INT 13h chain 142 in front of the xe2x80x9cfloppy emulationxe2x80x9d handler 166 by the procedure 100 (FIG. 1). When the device handler 168 receives an access request that is not directed to the device numbered 81h, the access request is passed either to the system handler 144 (step 130, FIG. 2) or to the xe2x80x9cfloppy emulationxe2x80x9d handler 166 (step 132, FIG. 2). However, when the access request is directed to the xe2x80x9cfloppy emulation El Toritoxe2x80x9d device, with device number 00h, as required by the xe2x80x9cEl Toritoxe2x80x9d standard, the device handler 168 passes the access request to the system handler 144 at step 130, instead of to the xe2x80x9cfloppy emulationxe2x80x9d handler 166, since the determination at step 128 (FIG. 2) is positive. Therefore, the xe2x80x9cfloppy emulationxe2x80x9d handler 166 is always bypassed when the access request is specifically directed to the xe2x80x9cfloppy emulation El Toritoxe2x80x9d device.
It is with respect to these and other background considerations that the present invention has evolved.
The present invention eliminates the above described problems involving xe2x80x9cEl Toritoxe2x80x9d devices installed in a PC. In particular, infinite loops are avoided and no device handler is bypassed, so every device handler can be properly accessed.
An improvement of the present invention involves a device handler that preferably xe2x80x9chooksxe2x80x9d both INT 13h and INT 40h by inserting the device handler into both the INT 13h chain and the INT 40h chain. In other words, when the device handler is installed, a vector pointing to it is inserted into the vector storage space for both INT 13h and 40h. Any previously inserted vectors in both vector storage spaces are retained by the device handler. When a subsequent device handler, whether a conventional device handler or another of the improved device handler, is installed, the vector for the previously installed improved device handler is copied from the affected vector storage space(s) for INT 13h and/or INT 40h.
In this manner, access requests are not misdirected. Instead, access requests that pass through either the INT 13h chain or the INT 40h chain are received by the improved handler, which determines the correct device that is to respond to the access request or the correct interrupt chain to which to pass the access request.